export function slide(fn,fn2,fn3){
		let flag = false;
		const start=[0,0]
		const end = [0,0]
		
		function slideStart(e){
			flag=true;
			start[0] = e.touches[0].clientX;
			start[1] = e.touches[0].clientY;
			fn2&&fn2(start,end)
		}
		function slideMove(e){
			if(!flag)return;
			end[0] = e.touches[0].clientX;
			end[1] = e.touches[0].clientY;
			fn&&fn(start,end)
		}
		function slideEnd(e){	
			if(!flag)return;
			fn3&&fn3(start,end)
			flag=false;
			start.splice(0)
			start.push(0,0)
			end.splice(0)
			end.push(0,0)
		}
		return {
			slideStart,
			slideMove,
			slideEnd
		}
	}